package kuzha.code;

import java.util.ArrayList;
import java.util.List;

import kuzha.ErrorReport;

public class CompileException extends Exception {
	private final List<ErrorReport> reports = new ArrayList<ErrorReport>();
	
	public CompileException() {
		super();
	}
	public CompileException(String message) {
		super(message);
	}
	public CompileException(Exception inner) {
		super(inner);
	}
	public CompileException(String message, Exception inner) {
		super(message, inner);
	}
	
	public void addErrorReport(ErrorReport report) {
		if (report != null) {
			reports.add(report);
		}
	}
	public void addErrorReport(ErrorReport... reports) {
		for(ErrorReport report: reports) {
			addErrorReport(report);
		}
	}
	public ErrorReport[] getErrorReport() {
		return reports.toArray(new ErrorReport[reports.size()]);
	}
}
